<?php
include"conn.php";
include"config.php";
include"Constants.php";

?>


<?php


if ($_POST['submit']) {
	$sql = "insert into ".TABLE_TEXT."(".TEXT_ID.",".TEXT_TYPE.",".TEXT_AUTHOR.",".TEXT_TITLE.",".TEXT_TEXT.",".TEXT_TIME.
		") values ('',".TYPE_TEXT.",'annie','$_POST[title]','$_POST[content]', now())";
	
	mysql_query($sql);
	

 echo $sql;
}

?>

<form action= "addText.php" method = "post" name = "form" onsubmit="return CheckPost();">
标题：
<br>
<input type = "text" size = "40" name = "title">
<br>
内容：
<br>
<input type = "text" name = "content">
<br>
<input type="submit" name = "submit" value = "发布留言"/>
</form>


<script type="text/javascript">
function CheckPost(){
	if (form.title.value=="") {
		alert("请填写标题");
		form.con.focus();
		return false;


	}
	
	if (form.content.value=="") {
		alert("请填写内容");
		form.content.focus();
		return false;

	};
}

</script>